package com.mtung.concurrent.thread;

/**
 * @author zhenguo.yao
 * @date 2020/12/16
 */
public class Thread01 implements Runnable {

    @Override
    public void run() {
        System.out.println("线程名: " + Thread.currentThread().getName() + ",子线程进来了");
        while (true) {
            // 什么都不做,就是不想让程序结束
        }
    }

    public static void main(String[] args) {
        Thread01 thread01 = new Thread01();
        Thread thread = new Thread(thread01);
        thread.start();

        thread.interrupt();

        System.out.println(Thread.currentThread().getName() + "测试");
    }

}
